package com.itheima.date.exception;

import java.text.ParseException;
import java.text.SimpleDateFormat;

public class Exception01 {
    public static void main(String[] args) throws ParseException {
       int[] arr=null;
       try{
           method2(arr);

       }catch (NullPointerException e){
           System.out.println("参数不能为空");
       }
        System.out.println("我最美");
    }

    private static void method2(int[] arr) throws  NullPointerException{
        if( arr==null){
            throw new NullPointerException();
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }

    private static void method1() throws ParseException {
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy年MM月dd日");
        sdf.parse("2048年10月10日");
    }
}
